cmake_minimum_required(VERSION 3.16)
project(test_pass_fail)

add_executable(main main.cpp)

enable_testing()
add_test(NAME mytest COMMAND main)

set_property(TEST mytest PROPERTY WILL_FAIL true)
